GBML manual / Constants

SPRITE_BAND

A band across the middle of the screen, and the sprite slides through it: full size on the middle line, then shrinking faster and faster toward the top and bottom of the band, and gone outside it. It is the same band as TEXT_BAND, the one the WARNING word of a boss introduction uses: at depth 3 it is exactly 64 rows tall. depth is how tall the band is: 1 is 128 rows, 2 is 96, 3 is 64, 4 is 48, 5 is 32 and 6 is 24.

Works differently on Game Boy - The Game Boy narrows the picture on some lines by moving its two sprite pieces toward each other (the middle is covered, not squeezed), a drum or a band hides it outside the lens; 16 pixels wide at most, one picture at a time; the size is not used.

Works differently on Game Boy Color - The Game Boy Color narrows the picture on some lines by moving its two sprite pieces toward each other (the middle is covered, not squeezed), a drum or a band hides it outside the lens; 16 pixels wide at most, one picture at a time; the size is not used.

Sega Genesis: not built yet

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

SPRITE_BAND: constant

Description

Names the band, a shape for draw_sprite_3d and draw_sprite_3d_scaled. It is the same band as TEXT_BAND, the shape of the WARNING word in a boss introduction, for a picture instead of words: a narrow band across the middle of the screen, and the sprite slides through it. On the middle line the sprite is full size. Toward the top and bottom of the band it shrinks, faster and faster, and at the edge of the band it is gone.

Like SPRITE_DRUM, the band belongs to the screen, not to the sprite. At depth 3 it is exactly 64 rows tall (32 rows above the middle line and 32 below), which is tighter than any drum. The size at k rows from the middle is 1 - 0.001 * k * (k + 1). TEXT_BAND has the whole account, including how depth sets the height: 1 is 128 rows, 2 is 96, 3 is 64, 4 is 48, 5 is 32 and 6 is 24. depth goes from 1 to 6 here, like the drum. A number below 1 draws the plain sprite, and a number above 6 is read as 6.

What to know before you use it

Example

draw_sprite_3d(spr_doc_tower, x, y, 0, SPRITE_BAND, 3);

The tower in a band of depth 3. Where it is on the screen decides how big it is: change y and it shrinks.

draw_sprite_3d(spr_doc_tower, x, y + wave(-30, 30, 120, 0), 0, SPRITE_BAND, 3);

A tower that moves up and down through the band over and over (one trip up and back every two seconds).

See also: draw_sprite_3ddraw_sprite_3d_scaledTEXT_BANDSPRITE_DRUMscreen_contrast